Okay, so last lesson we started off looking how to change properties okay.
And we looked at how to change properties with four different data types.
Now those data types are very common.
However there are four additional ones that are also very common that you need to know about.
Okay, now I know I said last lesson that these ones are a little bit more difficult.
Um, which they are.
It's more so you just have to remember more.
But I'm sure you'll be fine.
I'm going to go through this lesson slowly anyway.
Okay, so click on the part, get your script up and go down to position okay.
So position is the first one we're going to have a look at.
Now this has three numbers which is a bit difficult to work with.
Okay.
Um now if we were to reference position game dot workspace dot part dot position.
It's a vector three value okay.
But why isn't it a number if it has a number.
Well we can't just set the position equal ten for example.
Because it has free numbers.
So it's written in the properties here as free numbers with commas.
So why can't we put commas at ten, 20 and five.
Why can't we do that.
The reason is because the script does not understand free numbers at once.
Okay.
It doesn't understand it.
You have to be specific on what those free numbers mean.
Okay.
We're basically saying the position is equal to ten, is equal to 20 and is equal to five at the same
time.
Doesn't make sense to the script.
Okay.
Again the script is very specific.
You're going to learn this a lot.
I'm going to say this a lot throughout the course, but it's very specific on what it needs.
Okay.
You need to be very specific on what you give it.
So you have to leave.
Use an entirely new thing called vector three.
Now vector three basically allows the script to understand three numbers at once.
Okay.
It does that by basically saying the first number is the x value, the second number is the y value,
and the third number is the z value.
Instead of just giving it three numbers at once.
It's telling the script what those three numbers mean.
Okay.
So we write vector three after the property name and after the equals sign.
Okay.
So here goes vector three like that there.
Okay.
Now vector three is is a function of sorts.
Okay.
It's a couple of different types of functions.
You'll learn about them all throughout the course.
But it's a function function of kind.
Okay.
So it's a function with a with a little point.
Okay.
So it's a point or a dot after vector three.
And it has some kind of sub functions.
Guess again will learn all the proper terms for this later on.
But yeah.
And there's quite a few to choose from here.
But we are just looking at new for now.
Okay so vector three dot new with a pair of brackets after it.
Okay.
That brings us to this little menu here where it says x colon number, y colon number and z colon number.
You don't need to write the x colon bit.
It's just telling you to give the x value as a number.
The y value is a number and a z value as a number.
Okay so three numbers.
First one is x, second one is y, and third one's z.
So let's give it ten, 20 and five like I was going to do last time.
Okay.
Close the bracket and that's it.
That's your vector three.
Okay.
So it's um you need to victory first.nu.
The reason why it's dot nu is because we're giving it a new set of three numbers.
Okay.
There are other methods which we'll look at later on in the course.
Again.
You will you will know all this eventually.
Um, but for now it's just introducing the basics, which is just dot new.
For now.
It's simpler.
It's simpler just to learn that one first and then look at all the other types later on.
Okay.
Your three numbers go in there separated by commas.
Okay.
And always put space spaces after my commas again.
Makes it more readable and easier to read.
Um, again, if you don't want to, it won't throw any errors.
It won't break anything, but it's just highly recommended.
Okay.
And this here is your vector three.
Okay.
Now that's quite difficult.
That's that's quite you know for a couple lessons in going to that is quite, quite, quite um not difficult
but it's quite a lot.
So um, if you're not quite okay on that just yet that's fine.
It's quite a big step.
Okay.
Um, but you'll be happy to hear that for the next two properties follow a very similar format to that.
Okay.
Um, so vector three can be used for most properties that contain three numbers, but there are some
which you can't do it for.
For example color.
You cannot use vector three for color.
Now the reason why, if you paid very close attention to one of the earlier lessons where we talked
about properties, okay, which is color uses RGB, whereas position uses x, y and z.
So the numbers, even though those three numbers, they represent different things.
RGB goes from 0 to 255, whereas position can take any number including negatives.
So it makes sense to give it a different a different data type, because vector three wouldn't quite
work for it because you can have a negative position, but you can't have a negative color, you can't
have minus five amounts of red.
It doesn't make sense.
Okay.
Um, so let's reference the part again and let's reference the color property.
And this one's color three.
So we write this in the.
Exact same way as before.
So instead of writing vector three, we write color three.
Now the good bit about this is the name of the data type is always how you start it off.
If it tells you positions of vector three, you start off by writing vector three and usually it follows
by new okay.
Apart from the last property, the last datatype we're going to look at.
So it's a bit easier way to remember it I guess thinking of it that way.
Okay.
So color three dot new we're going to be using.
And in here you can put in three numbers.
Again instead of an x y z.
It's a red green and blue okay.
Um now these even though RGB is from 0 to 255 in color three dot new, you write it from 0 to 1.
Okay, so if you want 255 amounts of red, you would just say one.
So let's put one for red, 0.5 for green and 0.5 for blue.
And we get the kind of pink color there.
Okay.
And that is your color three.
Okay.
So color is kind of a property on itself.
It's only really used for color, nothing else.
But it's just for those cases where vector freq you can't use.
Okay.
Next we have brick color.
Now brick color is you can use it for this one here.
Now brick color is a weird property or a weird data type.
Um.
It has a bit more to it, which again we will look at later on in the course.
But you can't use something like string or anything like that, because if you click on color, if you
click on click on Brick Color, it has a little palette for you to use here.
But actually there's a lot more of these colors that exist.
They're just not shown on the palette.
Um, so you get all this kind of thing about indexes and stuff, but ignore that for now.
You will learn it eventually.
Okay.
Um, but for now, we're just going to accept that brick color.
You can't use something like string or anything else like that for it has to be the brick color property.
So brick color data type okay.
So let's reference it.
Let's use script dot method again.
Let's use script dot parent um dot part dot brick color.
See here.
The data type is literally called brick color okay.
Brick color again dot new okay.
And inside here I know it tells you here to use a number, but we're going to ignore that and use a
string instead okay.
Now you're going to think why the hell are we?
Um, you know, um, changing it from a value, a value of a number to a string.
That's because, um, we are putting in here this string inside of a string, um, the name of the brick
color.
Okay.
Um, so each brick color has its own name, but it also has a number.
Okay.
If you can remember all of the numbers, then great.
But it's much simpler, much easier just to use the name.
Okay.
So using the string.
But again we will look at that later on.
So you can just write in here the name of the brick color.
So you can scroll down here.
And you can see all the different names that you can pick from.
Let's pick another faded green for example.
And that there is our brick color okay.
So brick color there.
And we're choosing faded green for this one.
Okay.
Um, finally we are looking at one last data type, which is a bit different to the other ones.
Okay.
And one example of this is material which is here, sorry.
Materials under appearance here.
Okay.
Um, material is a list and we use this data type whenever you're looking at lists.
So script dot parent dot part dot material.
And this is important it will tell you for any list properties it will tell you enum dot and then a
another um another word as well.
That's very important okay.
Basically um this accepts an enum.
Now an now enum basically is a collection of all of a different lists that you can have in Roblox studio.
One of those lists is a list of the materials.
Okay.
So you can't just say enum and then go from there.
You have to be specific as enum is like saying you need to pick, you're getting all of the lists.
You need to select the one you want, okay, which is the list of all the materials.
So you will need to say um enum like that there dot material, very important dot material okay.
Because it's you're getting you get you're getting all of the lists and you're picking the one list.
You want the list of materials.
Okay.
And then you want to pick an entry from that list.
So any here you can pick okay.
So let's pick um grass for example.
Okay.
Just like that and that there is your enum.
One example I do need to show you um, about enums.
Um, is that the name of the property does not always equal the name of the, um, the name of a list,
for example, for the shape property, if you were to say script dot parent, dot part dot shape, it
says enum dot part type.
So it's very important to look at that.
Don't assume there's going to be the same as the name of the name of the property.
It's not always the case.
Okay.
Um, but yeah so they are your extra four data types.
And now there are a few more, but they're not used for part.
They're not used very commonly at all.
So we're not going to cover those just yet.
But these are the main eight that you will need to know.
Okay.
Most now you can with this you can now change about 1998 97.
Per cent of all properties in Redbook studio, not just for parts, but for anything else.
Okay, so it's up to you now to apply all this to some unfamiliar cases.
Unfamiliar properties.
And you can change them just by using that.
Okay, one last bit about properties is adding and taking away values from properties.
So in order to add take away times or divide values of properties okay, you need to know the symbols
to use them.
Okay.
So I'm going to just write them in notes here.
Okay.
So the symbol for plus is this here.
Okay.
You probably obviously seen that before.
The symbol for a minus sign is just a dash like that's there for symbol for for times.
Okay.
Is this little asterisks or star here.
Okay.
Has to be that one there.
And then for divide it's this slash here.
Now it's for slash two tilts to the right not the slash.
It tilts to the left.
That's different.
Okay.
Tilts to the right.
Very important.
Okay.
So there are your four different signs that you can use.
So let's look at these in some examples.
Okay.
So let's say you wanted to instead of giving it a whole new position let's say just increase the y position
by five.
So the parts stays in the same position but just goes up a bit by five.
Okay.
So we first reference the position.
So game dot workspace dot part dot position okay.
Um you can make it equal to.
Okay.
Now this is where it gets a little bit a little bit confusing.
This is a bit um is the most difficult to understand.
Okay.
Um, which is you then repeat saying game dot workspace dot part dot position.
The reason why you repeat it is because you're saying that the position is equal to the current position
plus another value.
Okay.
Um, you can't just say you can't ignore this bit and just say this bit here because you're not you're
not making anything equal to you're not following this structure here.
Okay.
Has to be written like this.
Again, it's quite long winded, but it's the only way you can do it.
And fortunately for now.
So, um, let's add a value onto here.
Now because position takes vector threes, we need to use a vector three value.
So we can say vector three dot new.
The second number is the y.
So we can say zero comma five comma zero like that there.
And now take the current position and add it.
Add five along the y onto it okay.
You can also do other things like divide be transparency by two.
To do that we would say game dot workspace dot path dot transparency is equal to game dot workspace
dot part dot transparency divided by two okay.
So just be comfortable with using those four symbols with your properties.
Sometimes it's easier just to add a value or take away value instead of giving it a whole new value.
Okay.
And they're mostly they're mostly used for vector three.
But any property including involving numbers.
So number integer vector three and color three you could technically use these for okay.
So that's hopefully that's been a good a good overview of all of the different data types that you could
use.
Okay.
Very important you practice all these.
But um I'm not just leaving you there because in all of our next lessons we will be looking at a lot
of properties as well.
Okay.
And I'll be giving you some different examples of different objects.
So you will have a bit of an overview as well.
But it is important that you try some of these out yourself.
Okay.
So um yeah try all of it.
Try those out.
Get comfortable with those.
But don't worry too much as you will be using those a lot throughout the course.
And next lesson, we're going to be having a look at another kind of function called weight called the
weight function.
I'm going to find out what that does.
And how it can be used in our script.